﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using Data;
using Entity;

namespace Business
{
    public class Customer_Business
    {
        public bool Add_Customer(Customer_Entity cus)
        {
            Customer_Data add_cus = new Customer_Data();
            return add_cus.Insert_Customer(cus);
        }
        public DataTable Load()
        {
            Customer_Data news = new Customer_Data();
            try
            {
                return news.Load();
            }
            catch
            {
                throw;
            }
            finally
            {
                news = null;
            }
        }
        public int Update(int cusID, string username, string password, string name, string address, int phone, int totalorders, int totalprice)
        {
            Customer_Data n = new Customer_Data();
            try
            {
                return n.Update_cus(cusID, username, password, name, address, phone, totalorders, totalprice);
            }
            catch
            {
                throw;
            }
            finally
            {
                n = null;
            }
        }
        public int Delete(int personID)
        {
            Customer_Data pDAL = new Customer_Data();
            try
            {
                return pDAL.Delete(personID);
            }
            catch
            {
                throw;
            }
            finally
            {
                pDAL = null;
            }
        }
    }
}
